<% content_for(:per_page_js) do 
     javascript_include_tag("reports", "https://www.google.com/jsapi") +
     # special google load thing
     javascript_tag('google.load("visualization", "1", {packages:["corechart"]});')
   end
%>

<%= flash_and_form_errors(@report) %>

<table>
  <tr>
    <td id="report_form" style="display: none">
      <%= render("form") %>
    </td>
    <td>
      <h1></h1>
      <div class="tip" id="report_nav_links">
        <%= join_links(
          link_to_if_auth("Edit This Report", "#", "report_reports#update", nil, :id => "edit_form_link"),
          link_to("Back to Report Listing", report_reports_path)
        ) %>
      </div>

      <div id="report_body"></div>
    </td>
  </tr>
</table>

<script type="text/javascript">
  $(document).ready(function(){
    report.obj = <%= @report.to_json.html_safe %>;
    report.init();
    <% if @show_form %> report.toggle_form(); <% end %>
    <% if flash[:saved] %> report.show_success(); <% end %>
  })
</script>